//
//  ZZIconButton.m
//  ZuZuBao
//
//  Created by Felix on 2024/4/9.
//

#import "ZZIconButton.h"

@interface ZZIconButton()

@property (nonatomic, strong) UIImageView * imgView;

@end

@implementation ZZIconButton

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        [self addSubview:self.imgView];
    }
    return self;
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(8, 8, self.frame.size.width - 16, self.frame.size.width - 16);
}

-(void)setButtonImage:(NSString *)image {
    self.imgView.image = [UIImage imageNamed:image];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
